<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>登录</title>
    <link rel="stylesheet" href="__STATIC__/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="__STATIC__/assets/css/login.css?v=316">
    <link rel="stylesheet" href="__STATIC__/assets/module/admin.css?v=316">
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script>
        if (window != top) {
            top.location.replace(location.href);
        }
    </script>
</head>
<body>
<div class="login-wrapper">
    <div class="login-header">
        <img src="__IMAGE__/logo.png"> 融媒体
    </div>
    <div class="login-body">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="layui-icon layui-icon-engine"></i>&nbsp;&nbsp;用户登录
            </div>
            <form class="layui-card-body layui-form layui-form-pane" lay-filter="formQA">
                <div class="layui-form-item">
                    <label class="layui-form-label"><i class="layui-icon layui-icon-username"></i></label>
                    <div class="layui-input-block">
                        <input name="username" type="text" placeholder="账号" class="layui-input"
                               lay-verType="tips" lay-verify="required" required/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><i class="layui-icon layui-icon-password"></i></label>
                    <div class="layui-input-block">
                        <input name="password" type="password" placeholder="密码" class="layui-input"
                               lay-verType="tips" lay-verify="required" required/>
                    </div>
                </div>
          <!--    <div class="layui-form-item">
                    <label class="layui-form-label"><i class="layui-icon layui-icon-vercode"></i></label>
                    <div class="layui-input-block">
                        <div class="layui-row inline-block">
                            <div class="layui-col-xs5">
                                <input type="text" name="captcha" lay-verify="required" autocomplete="off" placeholder="验证码" class="layui-input " style="width:80%;float: left;margin-right:11px;">

                            </div>
                            <div class="layui-col-xs5" >
                                <img src="{:__url('login/verify')}" alt="captcha" class="login-captcha" height="36" id="captcha" style="margin-top: 1px" />

                            </div>
                        </div>
                    </div>
                </div>-->
                <!--<div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"><i class="fa fa-code"></i></label>
                    <input type="text" name="captcha" lay-verify="required" autocomplete="off" placeholder="验证码" class="layui-input" style="width:62%;float: left;margin-right:11px;">
                    <img src="{:captcha_src()}" alt="captcha" onclick="this.src='{:captcha_src()}?seed='+Math.random()" height="36" id="captcha" style="margin-top: 1px" />
                </div>-->
                <div class="layui-form-item">
                    <button  class="layui-btn layui-btn-fluid" lay-filter="formSubmitAQ" lay-submit>登 录</button>
                </div>

            </form>
        </div>
    </div>

</div>

<!-- js部分 -->
<script type="text/javascript" src="__STATIC__/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="__STATIC__/assets/js/common.js?v=316"></script>
<script>
    layui.use(['layer', 'form'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        // 表单提交
        // 表单提交事件
        form.on('submit(formSubmitAQ)', function (data) {
            //验证验证码

            $.post("{:__url('login/index') }", {
                'data':data.field
            }, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1,time:1000}, function () {
                        location.replace('{:__url("index/index")}')
                    })
                } else {
                    layer.msg(res.msg, {icon: 2,time:1000})
                }
            });
            /*layer.msg('登录成功', {icon: 1, time: 1500}, function () {
                location.replace('../../index.html')
            });*/
            return false;
        });

        // 图形验证码
        $('.login-captcha').click(function () {
             // console.log(111);
            this.src = this.src + '?t=' + (new Date).getTime();
        });
    });
</script>
</body>
</html>